<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>this</title>
</head>
<body>
    <script>
        var name = "window";
         var obj = {
            name:"obj",
            foo:function()
            {
                return function()
                {
                    console.log(this.name);
                }
            }
         }

         
         obj.foo()();
         
    </script>
</body>
</html>